package model;

import java.util.Date;

/**
 * 车票实体类
 */
public class Ticket {
    private int id;
    private int userId;
    private int trainId;
    private String seatNumber;
    private Date bookingTime;
    private double price;
    private boolean isCancelled;
    private boolean isStudentTicket; // 添加是否学生票属性

    public Ticket() {}

    public Ticket(int userId, int trainId, String seatNumber, Date bookingTime, double price, boolean isStudentTicket) {
        this.userId = userId;
        this.trainId = trainId;
        this.seatNumber = seatNumber;
        this.bookingTime = bookingTime;
        this.price = price;
        this.isCancelled = false;
        this.isStudentTicket = isStudentTicket;
    }

    public int getId() { return id; }
    public void setId(int id) { this.id = id; }

    public int getUserId() { return userId; }
    public void setUserId(int userId) { this.userId = userId; }

    public int getTrainId() { return trainId; }
    public void setTrainId(int trainId) { this.trainId = trainId; }

    public String getSeatNumber() { return seatNumber; }
    public void setSeatNumber(String seatNumber) { this.seatNumber = seatNumber; }

    public Date getBookingTime() { return bookingTime; }
    public void setBookingTime(Date bookingTime) { this.bookingTime = bookingTime; }

    public double getPrice() { return price; }
    public void setPrice(double price) { this.price = price; }

    public boolean isCancelled() { return isCancelled; }
    public void setCancelled(boolean cancelled) { isCancelled = cancelled; }

    public boolean isStudentTicket() { return isStudentTicket; }
    public void setStudentTicket(boolean studentTicket) { isStudentTicket = studentTicket; }
}